home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / proboard / pb_215.zip / PB_SDK.H < prev    next >
C/C++ Source or Header  |  1996-05-05  |  47KB  |  1,175 lines

  1. #ifndef _PB_SDK_H
  2. #define _PB_SDK_H
  3.  
  4. #define PBSDK_VERSION 215
  5.  
  6. /*╒═════════════════════════════════════════╤══════════════════════════════╕*/
  7. /*│ ProBoard Software Development Kit v2.15 │  C/C++ library declarations  │*/
  8. /*╞═════════════════════════════════════════╧══════════════════════════════╡*/
  9. /*│           Only functions in this header file are supported             │*/
  10. /*├────────────────────────────────────────────────────────────────────────┤*/
  11. /*│     !! ───────────>> Only use LARGE memory model <<──────────── !!     │*/
  12. /*└────────────────────────────────────────────────────────────────────────┘*/
  13.  
  14.  
  15. #ifndef PB_SDK
  16.   #define PB_SDK 1
  17. #endif
  18.  
  19. #ifdef __cplusplus
  20.  extern "C" {
  21. #endif
  22.  
  23. #define NULL (0L)
  24. #define FAR far
  25. #define TRUE (1)
  26. #define FALSE (0)
  27.  
  28. typedef int           FILE;
  29. typedef unsigned      size_t;
  30. typedef long          clock_t;
  31. typedef long          time_t;
  32. typedef char         *va_list;
  33.  
  34. #define va_start(ap,parmn)  ((ap) = (va_list)&(parmn) + sizeof(parmn))
  35. #define va_arg(ap,type) (*((type *)(ap))++)
  36. #define va_end(ap)
  37.  
  38. struct find_t              /* used by dos_findfirst() & dos_findnext() */
  39.   {
  40.    char     reserved[21];      /* reserved by DOS                      */
  41.    char     attrib;            /* attribute found (FA_XXXX)            */
  42.    unsigned time,date;         /* file's last write                    */
  43.    unsigned long size;         /* file's size                          */
  44.    char     name[13];          /* filename followed by 0 byte          */
  45.   };
  46.  
  47. /* Used in dos_findfirst & dos_findnext */
  48.  
  49. #define FA_NORMAL 0x00
  50. #define FA_RDONLY    0x01
  51. #define FA_HIDDEN    0x02
  52. #define FA_SYSTEM    0x04
  53. #define FA_LABEL    0x08
  54. #define FA_DIREC    0x10
  55. #define FA_ARCH        0x20
  56.  
  57. #define FP_SEG(fp)    ((unsigned)((unsigned long)(fp) >> 16))
  58. #define FP_OFF(fp)  ((unsigned)((unsigned long)(fp)))
  59.  
  60. #define MK_FP(seg,offset) ((void FAR *)(((unsigned long)(seg)<<16) | (unsigned)(offset)))
  61.  
  62. struct WREGS
  63.    {
  64.     unsigned ax,bx,cx,dx,si,di,cflag,flags;
  65.    };
  66.  
  67. struct BREGS
  68.    {
  69.     unsigned char al,ah,bl,bh,cl,ch,dl,dh;
  70.    };
  71.  
  72. union REGS
  73.    {
  74.     struct WREGS x;
  75.     struct BREGS h;
  76.    };
  77.  
  78. struct SREGS
  79.    {
  80.     unsigned es,cs,ss,ds;
  81.    };
  82.  
  83. extern int errno;
  84.  
  85. #define ENOENT  2
  86. #define ENOTDIR    3
  87. #define EMFILE    4
  88. #define EACCES    5
  89. #define EBADF    6
  90. #define ENOMEM    8
  91. #define EINVAL    22
  92. #define EEXIST    80
  93.  
  94. #define E2BIG    1000
  95. #define ENOEXEC    1001
  96. #define EDOM    1002
  97. #define    ERANGE    1003
  98.  
  99. #define O_RDONLY  0
  100. #define O_WRONLY    1
  101. #define O_RDWR        2
  102.  
  103. #define O_NOINHERIT 0x80
  104. #define O_DENYALL   0x10
  105. #define O_DENYWRITE 0x20
  106. #define O_DENYREAD  0x30
  107. #define O_DENYNONE  0x40
  108.  
  109. #define S_IREAD  0x0100
  110. #define S_IWRITE 0x0080
  111.  
  112. #define O_BINARY        0
  113.  
  114. #define _IOFBF  0
  115. #define _IOLBF  1
  116. #define _IONBF  2
  117.  
  118. #define F_OK    0       /* does file exist?     */
  119. #define X_OK    1    /* execute permission?    */
  120. #define W_OK    2    /* write permission?    */
  121. #define R_OK    4    /* read permission?    */
  122.  
  123. #define SEEK_SET    0    /* seek from start of file    */
  124. #define SEEK_CUR    1    /* relative to current position    */
  125. #define SEEK_END    2    /* relative to end of file    */
  126.  
  127. struct tm
  128.   {
  129.    int tm_sec,         /* seconds 0..59                        */
  130.        tm_min,         /* minutes 0..59                        */
  131.        tm_hour,        /* hour of day 0..23                    */
  132.        tm_mday,        /* day of month 1..31                   */
  133.        tm_mon,         /* month 0..11                          */
  134.        tm_year,        /* years since 1900                     */
  135.        tm_wday,        /* day of week, 0..6 (Sunday..Saturday) */
  136.        tm_yday,        /* day of year, 0..365                  */
  137.        tm_isdst;       /* >0 if daylight savings time          */
  138.                        /* ==0 if not DST                       */
  139.                        /* <0 if don't know                     */
  140.   };
  141.  
  142. FILE *  fopen(const char *,const char *);
  143. FILE *  freopen(const char *,const char *,FILE *);
  144. int     fseek(FILE *,long,int);
  145. long    ftell(FILE *);
  146. char *  fgets(char *,int,FILE *);
  147. int     fgetc(FILE *);
  148. int     fflush(FILE *);
  149. int     fclose(FILE *);
  150. int     fputs(const char *,FILE *);
  151. int     getc(FILE *);
  152. int     getchar(void);
  153. char *  gets(char *);
  154. int     fputc(int,FILE *);
  155. int     putc(int,FILE *);
  156. int     putchar(int);
  157. int     puts(const char *);
  158. size_t  fread(void *,size_t,size_t,FILE *);
  159. size_t  fwrite(const void *,size_t,size_t,FILE *);
  160. int     printf(const char *,...);
  161. int     fprintf(FILE *,const char *,...);
  162. int     vfprintf(FILE *,const char *,va_list);
  163. int     vprintf(const char *,va_list);
  164. int     sprintf(char *,const char *,...);
  165. int     vsprintf(char *,const char *,va_list);
  166. void    setbuf(FILE *,char *);
  167. int     setvbuf(FILE *,char *,int,size_t);
  168. int     remove(const char *);
  169. int     rename(const char *,const char *);
  170. void    rewind(FILE *);
  171. void    clearerr(FILE *);
  172. int     feof(FILE *);
  173.  
  174. int     isalnum(int);
  175. int     isalpha(int);
  176. int     iscntrl(int);
  177. int     isdigit(int);
  178. int     isgraph(int);
  179. int     islower(int);
  180. int     isprint(int);
  181. int     ispunct(int);
  182. int     isspace(int);
  183. int     isupper(int);
  184. int     isxdigit(int);
  185. int     toupper(int);
  186. int     tolower(int);
  187.  
  188. int     int86(int,union REGS *,union REGS *);
  189. int     int86x(int,union REGS *,union REGS *,struct SREGS *);
  190. int     intdos(union REGS *,union REGS *);
  191. int     intdosx(union REGS *,union REGS *,struct SREGS *);
  192. int     dos_findfirst(const char *, unsigned, struct find_t *);
  193. int     dos_findnext(struct find_t *);
  194.  
  195. int     mkdir(const char *);
  196. int     rmdir(const char *);
  197. int     chdir(const char *);
  198.  
  199. int     read(int,void *,unsigned);
  200. int     write(int,const void *,unsigned);
  201. int     open(const char *,int);
  202. int     creat(const char *,int);
  203. int     close(int);
  204. int     unlink(const char *);
  205. int     chsize(int, long);
  206. int     dup(int);
  207. int     dup2(int, int);
  208. long    lseek(int,long,int);
  209. int     access(const char *,int);
  210. long    filelength(int);
  211. int     isatty(int);
  212.  
  213. int     atoi(const char *);
  214. long    atol(const char *);
  215. long    strtol(const char *,char **,int);
  216. int     rand(void);
  217. void    srand(unsigned);
  218. void *  calloc(size_t,size_t);
  219. void    free(void *);
  220. void *  malloc(size_t);
  221. void *  realloc(void *,size_t);
  222. char *  getenv(const char *);
  223. int     putenv(const char *);
  224. int     abs(int);
  225. long    labs(long);
  226.  
  227. void *  memcpy(void *,const void *,size_t);
  228. void *  memmove(void *,const void *,size_t);
  229. char *  strcpy(char *,const char *);
  230. char *  strncpy(char *,const char *,size_t);
  231. char *  strcat(char *,const char *);
  232. char *  strncat(char *,const char *,size_t);
  233. int     memcmp(const void *,const void *,size_t);
  234. int     strcmp(const char *,const char *);
  235. int     strncmp(const char *,const char *,size_t);
  236. void *  memchr(const void *,int,size_t);
  237. char *  strchr(const char *,int);
  238. size_t  strcspn(const char *,const char *);
  239. char *  strpbrk(const char *,const char *);
  240. char *  strrchr(const char *,int);
  241. size_t  strspn(const char *,const char *);
  242. char *  strstr(const char *,const char *);
  243. char *  strtok(char *,const char *);
  244. void *  memset(void *,int,size_t);
  245. size_t  strlen(const char *);
  246.  
  247. int     memicmp(const void *,const void *,size_t);
  248. char *  stpcpy(char *,const char *);
  249. int     strcmpl(const char *,const char *);
  250. int     strnicmp(const char *,const char *, size_t);
  251. char *  strdup(const char *);
  252. char *  strlwr(char *);
  253. char *  strupr(char *);
  254. char *  strnset(char *,int,size_t);
  255. char *  strrev(char *);
  256. char *  strset(char *,int);
  257. void    swab(char *,char *,size_t);
  258.  
  259. #define strncmpl(a,b,c) strnicmp((a),(b),(c))
  260. #define stricmp(a,b)    strcmpl((a),(b))
  261. #define delay(a)        msleep(a)
  262.  
  263. clock_t clock(void);
  264. time_t  time(time_t *);
  265. time_t  mktime(struct tm *);
  266. char *  asctime(const struct tm *);
  267. char *  ctime(time_t *);
  268. struct tm * localtime(const time_t *);
  269. struct tm * gmtime(const time_t *);
  270. size_t  strftime(char *,size_t,const char *,struct tm *);
  271.  
  272. #define difftime(t1,t2)   (((time_t)(t1) - (time_t)(t2)))
  273.  
  274. void sleep(time_t);
  275. void usleep(unsigned long);
  276. void msleep(unsigned long);
  277.  
  278. /* ------------------------------------------------------------------------- */
  279. /* ------ END OF STANDARD LIBRARY SECTION ---------------------------------- */
  280. /* ------------------------------------------------------------------------- */
  281.  
  282. /*****************************************************************************/
  283. /****  ProBoard specific #defines and structures  ****************************/
  284. /*****************************************************************************/
  285.  
  286. typedef unsigned char  bool;
  287. typedef unsigned char  byte;
  288. typedef unsigned short word;
  289. typedef unsigned long  dword;
  290. typedef word           KEY;
  291.  
  292. typedef byte  DateType[3];
  293. typedef byte  TimeType[3];
  294.  
  295. typedef byte  TimeFrame[7][6];
  296.  
  297. typedef dword accessflags;
  298. typedef byte  combinedboards[125];
  299.  
  300. /* Modes for Input() */
  301. #define INPUT_ALL       0
  302. #define INPUT_UPFIRST   1
  303. #define INPUT_UPALL     2
  304. #define INPUT_DIGITS    3
  305. #define INPUT_PWD      64   /* OR */
  306. #define INPUT_NOFIELD 128   /* OR */
  307.  
  308. /* Paramaters for SetColor() */
  309. #define BLACK   0x00
  310. #define RED     0x01
  311. #define GREEN   0x02
  312. #define YELLOW  0x03
  313. #define MAGENTA 0x04
  314. #define BLUE    0x05
  315. #define CYAN    0x06
  316. #define WHITE   0x07
  317.  
  318. #define BLINK   0x10   /* OR together for flashing colors      */
  319.  
  320.  
  321. /* Used for MenuFunction() */
  322. #define MENU_GOTOMENU            1
  323. #define MENU_GOSUBMENU           2
  324. #define MENU_PREVMENU            3
  325. #define MENU_GOTOMENUCLEAR       4
  326. #define MENU_SHOWANSASC          5
  327. #define MENU_COUNTRY_CHANGE      6
  328. #define MENU_SHELL               7
  329. #define MENU_VERSION_INFO        8
  330. #define MENU_LOGOFF              9
  331. #define MENU_USAGE_GRAPH        10
  332. #define MENU_PAGESYSOP          11
  333. #define MENU_QUESTIONNAIRE      12
  334. #define MENU_USER_LIST          13
  335. #define MENU_TIME_STAT          14
  336. #define MENU_VIEW_ANS_WAIT      15
  337. #define MENU_CITY_CHANGE        16
  338. #define MENU_PASSWORD_CHANGE    17
  339. #define MENU_LINES_CHANGE       18
  340. #define MENU_CLS_TOGGLE         19
  341. #define MENU_PAUSE_TOGGLE       20
  342. #define MENU_ANSI_TOGGLE        21
  343. #define MENU_MAILCHECK          22
  344. #define MENU_READMSG            23
  345. #define MENU_SCAN_MSG           24
  346. #define MENU_QSCAN_MSG          25
  347. #define MENU_DAYS_GRAPH         26
  348. #define MENU_WRITEMSG           27
  349. #define MENU_COMBINED_SELECT    28
  350. #define MENU_WEEKS_GRAPH        29
  351. #define MENU_RAW_DIR            30
  352. #define MENU_LIST_FILES         31
  353. #define MENU_DOWNLOAD           32
  354. #define MENU_UPLOAD             33
  355. #define MENU_LIST_ARCHIVE       34
  356. #define MENU_KEYWORD_SEARCH     35
  357. #define MENU_FILENAME_SEARCH    36
  358. #define MENU_NEW_FILES          37
  359. #define MENU_VIEW_FILE          38
  360. #define MENU_VIEW_NAMED_FILE    39
  361. #define MENU_FSED_TOGGLE        41
  362. #define MENU_HOTKEY_TOGGLE      42
  363. #define MENU_CLEARMARKED        43
  364. #define MENU_COMBINED_CLEAR     44
  365. #define MENU_VIEW_FILE_WAIT     45
  366. #define MENU_CHANGE_ACCESS      46
  367. #define MENU_LOGENTRY           47
  368. #define MENU_TOPS               48
  369. #define MENU_SET_MSGAREA        49
  370. #define MENU_SHOW_USERS_ONLINE  50
  371. #define MENU_LASTCALLERS        51
  372. #define MENU_USEREDITOR         52
  373. #define MENU_MULTICHAT          53
  374. #define MENU_SET_FILEAREA       54
  375. #define MENU_VIEW_GIF           55
  376. #define MENU_IBM_TOGGLE         56
  377. #define MENU_PHONE_CHANGE       57
  378. #define MENU_DATAPHONE_CHANGE   58
  379. #define MENU_HANDLE_CHANGE      59
  380. #define MENU_RUN_SDKFILE        60
  381. #define MENU_SHOW_BULLETIN      61
  382. #define MENU_AVT0               62
  383. #define MENU_AVT1               63
  384. #define MENU_SHOW_GRAPH         64
  385. #define MENU_RIP_FONT           66
  386. #define MENU_RIP_GRAPHICS       67
  387. #define MENU_EDIT_TAGGED        68
  388. #define MENU_SELECT_LANGUAGE    69
  389. #define MENU_CHANGE_DATE_FORMAT     70
  390. #define MENU_CHANGE_MAILING_ADDRESS 71
  391. #define MENU_CHANGE_FAX_NUMBER  72
  392. #define MENU_CHANGE_COUNTRY     73
  393.  
  394.  
  395. /* Handler modes */
  396. #define HANDLER_SYSOPKEY         6
  397. #define HANDLER_HANGUP           7
  398.  
  399. #define HANDLED     1
  400. #define NOT_HANDLED 0
  401.  
  402. /* Loglevels */
  403. #define LOG_FRIEND     0
  404. #define LOG_NORMAL     1
  405. #define LOG_SUSPICIOUS 2
  406. #define LOG_DANGEROUS  3
  407.  
  408. /**** KEY scan codes ****/
  409. #define KEY_F1   0x3B00U
  410. #define KEY_F2   0x3C00U
  411. #define KEY_F3   0x3D00U
  412. #define KEY_F4   0x3E00U
  413. #define KEY_F5   0x3F00U
  414. #define KEY_F6   0x4000U
  415. #define KEY_F7   0x4100U
  416. #define KEY_F8   0x4200U
  417. #define KEY_F9   0x4300U
  418. #define KEY_F10  0x4400U
  419.  
  420. #define KEY_SF1   0x5400U
  421. #define KEY_SF2   0x5500U
  422. #define KEY_SF3   0x5600U
  423. #define KEY_SF4   0x5700U
  424. #define KEY_SF5   0x5800U
  425. #define KEY_SF6   0x5900U
  426. #define KEY_SF7   0x5A00U
  427. #define KEY_SF8   0x5B00U
  428. #define KEY_SF9   0x5C00U
  429. #define KEY_SF10  0x5D00U
  430.  
  431. #define KEY_CF1   0x5E00U
  432. #define KEY_CF2   0x5F00U
  433. #define KEY_CF3   0x6000U
  434. #define KEY_CF4   0x6100U
  435. #define KEY_CF5   0x6200U
  436. #define KEY_CF6   0x6300U
  437. #define KEY_CF7   0x6400U
  438. #define KEY_CF8   0x6500U
  439. #define KEY_CF9   0x6600U
  440. #define KEY_CF10  0x6700U
  441.  
  442. #define KEY_AF1   0x6800U
  443. #define KEY_AF2   0x6900U
  444. #define KEY_AF3   0x6A00U
  445. #define KEY_AF4   0x6B00U
  446. #define KEY_AF5   0x6C00U
  447. #define KEY_AF6   0x6D00U
  448. #define KEY_AF7   0x6E00U
  449. #define KEY_AF8   0x6F00U
  450. #define KEY_AF9   0x7000U
  451. #define KEY_AF10  0x7100U
  452.  
  453. #define KEY_ALT1 0x7800U
  454. #define KEY_ALT2 0x7900U
  455. #define KEY_ALT3 0x7A00U
  456. #define KEY_ALT4 0x7B00U
  457. #define KEY_ALT5 0x7C00U
  458. #define KEY_ALT6 0x7D00U
  459. #define KEY_ALT7 0x7E00U
  460. #define KEY_ALT8 0x7F00U
  461. #define KEY_ALT9 0x8000U
  462. #define KEY_ALT0 0x8100U
  463.  
  464. #define KEY_ALTA 0x1E00U
  465. #define KEY_ALTB 0x3000U
  466. #define KEY_ALTC 0x2E00U
  467. #define KEY_ALTD 0x2000U
  468. #define KEY_ALTE 0x1200U
  469. #define KEY_ALTF 0x2100U
  470. #define KEY_ALTG 0x2200U
  471. #define KEY_ALTH 0x2300U
  472. #define KEY_ALTI 0x1700U
  473. #define KEY_ALTJ 0x2400U
  474. #define KEY_ALTK 0x2500U
  475. #define KEY_ALTL 0x2600U
  476. #define KEY_ALTM 0x3200U
  477. #define KEY_ALTN 0x3100U
  478. #define KEY_ALTO 0x1800U
  479. #define KEY_ALTP 0x1900U
  480. #define KEY_ALTQ 0x1000U
  481. #define KEY_ALTR 0x1300U
  482. #define KEY_ALTS 0x1F00U
  483. #define KEY_ALTT 0x1400U
  484. #define KEY_ALTU 0x1600U
  485. #define KEY_ALTV 0x2F00U
  486. #define KEY_ALTW 0x1100U
  487. #define KEY_ALTX 0x2D00U
  488. #define KEY_ALTY 0x1500U
  489. #define KEY_ALTZ 0x2C00U
  490.  
  491. #define KEY_CTLA 0x0001U
  492. #define KEY_CTLB 0x0002U
  493. #define KEY_CTLC 0x0003U
  494. #define KEY_CTLD 0x0004U
  495. #define KEY_CTLE 0x0005U
  496. #define KEY_CTLF 0x0006U
  497. #define KEY_CTLG 0x0007U
  498. #define KEY_CTLH 0x0008U
  499. #define KEY_CTLI 0x0009U
  500. #define KEY_CTLJ 0x000AU
  501. #define KEY_CTLK 0x000BU
  502. #define KEY_CTLL 0x000CU
  503. #define KEY_CTLM 0x000DU
  504. #define KEY_CTLN 0x000EU
  505. #define KEY_CTLO 0x000FU
  506. #define KEY_CTLP 0x0010U
  507. #define KEY_CTLQ 0x0011U
  508. #define KEY_CTLR 0x0012U
  509. #define KEY_CTLS 0x0013U
  510. #define KEY_CTLT 0x0014U
  511. #define KEY_CTLU 0x0015U
  512. #define KEY_CTLV 0x0016U
  513. #define KEY_CTLW 0x0017U
  514. #define KEY_CTLX 0x0018U
  515. #define KEY_CTLY 0x0019U
  516. #define KEY_CTLZ 0x001AU
  517.  
  518. #define KEY_DEL  0x5300U
  519. #define KEY_INS  0x5200U
  520. #define KEY_HOME 0x4700U
  521. #define KEY_END  0x4F00U
  522.  
  523. #define KEY_PGUP 0x4900U
  524. #define KEY_PGDN 0x5100U
  525. #define KEY_UP   0x4800U
  526. #define KEY_DN   0x5000U
  527. #define KEY_LT   0x4B00U
  528. #define KEY_RT   0x4D00U
  529.  
  530. #define KEY_ESC  0x001BU
  531. #define KEY_ENT  0x000DU
  532. #define KEY_RET  0x000DU
  533. #define KEY_TAB  0x0009U
  534. #define KEY_STAB 0x0F00U
  535. #define KEY_CPGUP 0x8400U
  536. #define KEY_CPGDN 0x7600U
  537.  
  538.  
  539. /** User flags *******************************************************/
  540. #define UFLAG_DELETED    (0x00000001L) /*  0 // User deleted                */
  541. #define UFLAG_ANSI       (0x00000002L) /*  1 // ANSI mode ON                */
  542. #define UFLAG_PAUSE      (0x00000004L) /*  2 // Pause mode ON               */
  543. #define UFLAG_CLEAR      (0x00000008L) /*  3 // Screenclear mode ON         */
  544. #define UFLAG_HOTKEYS    (0x00000010L) /*  4 // Hotkeys?                    */
  545. #define UFLAG_NOIBM      (0x00000020L) /*  5 // User has no IBM-graphics    */
  546. #define UFLAG_FSED       (0x00000040L) /*  6 // Fullscreen editor used      */
  547. #define UFLAG_NOKILL     (0x00000080L) /*  7 // Do not kill user            */
  548. #define UFLAG_IGNORE     (0x00000100L) /*  8 // Ignore DL-hours             */
  549. #define UFLAG_ATTEN      (0x00000200L) /*  9 // Attention flag              */
  550. #define UFLAG_NOTOPS     (0x00000400L) /* 10 // Don't appear in tops        */
  551. #define UFLAG_HIDDEN     (0x00000800L) /* 11 // Hide from lists             */
  552. #define UFLAG_QUIET      (0x00001000L) /* 12 // Quiet??                     */
  553. #define UFLAG_AVATAR     (0x00002000L) /* 13 // AVT/0 codes                 */
  554. #define UFLAG_AVTPLUS    (0x00004000L) /* 14 // AVT/0+ codes                */
  555. #define UFLAG_GUEST      (0x00008000L) /* 15 // Guest account               */
  556. #define UFLAG_PAGEPRI    (0x00010000L) /* 16 // Page priority               */
  557. #define UFLAG_LOCALONLY  (0x00020000L) /* 17 // Local login only            */
  558. #define UFLAG_MULTILOGIN (0x00040000L) /* 18 // Allow multiple login        */
  559. #define UFLAG_FREECHAT   (0x00080000L) /* 19 // Freeze timer in chat        */
  560. #define UFLAG_NORIP      (0x00100000L) /* 20 // Disable RIP                 */
  561.  
  562. #define MSG_LOCAL   0
  563. #define MSG_NET     1
  564. #define MSG_ECHO    2
  565. #define MSG_PVTECHO 3
  566.  
  567. #define MSG_BOTH  0
  568. #define MSG_PVT   1
  569. #define MSG_PUB   2
  570. #define MSG_TOALL 3
  571.  
  572. #define MSGATTR_PRIVATE     (0x00000001L)
  573. #define MSGATTR_RECEIVED    (0x00000002L)
  574. #define MSGATTR_DELETED     (0x00000004L)
  575. #define MSGATTR_NETMAIL     (0x00000008L)
  576. #define MSGATTR_UNSENT_ECHO (0x00000010L)
  577. #define MSGATTR_UNSENT_NET  (0x00000020L)
  578. #define MSGATTR_LOCAL       (0x00000040L)
  579. #define MSGATTR_KILL        (0x00000080L)
  580. #define MSGATTR_CRASH       (0x00000100L)
  581. #define MSGATTR_SENT        (0x00000200L)
  582. #define MSGATTR_FILE        (0x00000400L)
  583. #define MSGATTR_REQ         (0x00000800L)
  584. #define MSGATTR_AUDIT       (0x00001000L)
  585. #define MSGATTR_RET         (0x00002000L)
  586.  
  587.  
  588. /**** NOTE *******************************************************************/
  589. /*                                                                           */
  590. /*  Dates are stored as an array of 3 bytes, the first byte is the day       */
  591. /*  portion, the second byte is the month portion, and the third byte is the */
  592. /*  year portion (00-99). Times are stored in a similar way: the first byte  */
  593. /*  is the hour portion (00-24), the second byte is the minute portion       */
  594. /*  (00-59), and the third byte is the seconds portion (00-59).              */
  595. /*                                                                           */
  596. /*****************************************************************************/
  597.  
  598. typedef struct
  599.    {
  600.     long         record;                /* Record number in USERS.BBS           */
  601.  
  602.     char         name[36];              /* User name                            */
  603.     char         alias[36];             /* Alias/Handle                         */
  604.     char         passWord[16];          /* Password                             */
  605.     dword        passWordCRC;
  606.     word         level;                 /* Security level                       */
  607.     char         country[26];           /* Country                              */
  608.     char         state[26];             /* State                                */
  609.     char         city[26];              /* City                                 */
  610.     char         company[51];           /* Company                              */
  611.  
  612.     char         address1[51];          /* Address line 1                       */
  613.     char         address2[51];          /* Address line 2                       */
  614.     char         address3[51];          /* Address line 3                       */
  615.  
  616.     char         comment[81];           /* Comment                              */
  617.     char         forwardTo[36];         /* Forward mail to                      */
  618.  
  619.     DateType     birthDate;             /* Birthday                             */
  620.  
  621.     char         voicePhone[16];        /* Voice phone #                        */
  622.     char         dataPhone [16];        /* Data phone #                         */
  623.     char         faxPhone  [16];        /* Fax phone #                          */
  624.  
  625.     byte         sex;                   /* 0 = Unknown, 1 = Male, 2 = Female    */
  626.     byte         dateFormat;            /* Date Format                          */
  627.     byte         defaultProtocol;       /* Default protocol hotkey              */
  628.     char         language[9];           /* Language                             */
  629.     word         screenWidth;           /* Screen Width                         */
  630.     word         screenLength;          /* # of lines                           */
  631.  
  632.     long         timeUsed;              /* time used today                      */
  633.  
  634.     dword        timesCalled;           /* # times called                       */
  635.     dword        numDownloads;          /* # downloads                          */
  636.     dword        kbDownloaded;          /* K downloaded                         */
  637.     dword        numUploads;            /* # downloads                          */
  638.     dword        kbUploaded;            /* K downloaded                         */
  639.     dword        msgsPosted;            /* # messages posted                    */
  640.  
  641.     DateType     lastDate;              /* Date last called                     */
  642.     DateType     lastTime;              /* Time last called                     */
  643.     DateType     lastPwdChange;         /* Date of last password change         */
  644.     DateType     lastNewFilesCheck;     /* Date of last check for new files     */
  645.  
  646.     accessflags  aFlags;                /* Access flags       (A-Z,1-6)         */
  647.     dword        uFlags;                /* Flags (DELETED/ANSI/PAUSE/...)       */
  648.     word         logLevel;              /* Log level of user                    */
  649.  
  650.     byte         mailCheckBoards[125];  /* Msg areas to check for mail          */
  651.     byte         combinedBoards[125];   /* Areas to be used in combined mode    */
  652.  
  653.     dword        totalTimeUsed;         /* Total time used (minutes)            */
  654.  
  655.     DateType     expDate;               /* Expiration date                      */
  656.     word         expLevel;              /* Fallback level after expiration      */
  657.     accessflags  expFlagsOn;            /* Flags to be enabled after expiration */
  658.     accessflags  expFlagsOff;           /* Flags to be disabled after expiration*/
  659.  
  660.     DateType     firstDate;             /* Date of first login                  */
  661.     long         kbToday;               /* K downloaded today                   */
  662.     long         credit;                /* Netmail credit                       */
  663.     long         pending;               /* Netmail credit pending               */
  664.     word         fileArea;              /* Last file area accessed              */
  665.     word         msgArea;               /* Last msg area accessed               */
  666.  
  667.     int          tbTimeBalance;         /* Time balance           (Time Bank)   */
  668.     int          tbKbBalance;           /* Kbyte balance          (Time Bank)   */
  669.     int          tbTimeWithdrawn;       /* Time withdrawn today   (Time Bank)   */
  670.     int          tbKbWithdrawn;         /* Kbytes withdrawn today (Time Bank)   */
  671.     word         tbTimeDeposited;
  672.     word         tbKbDeposited;
  673.     word         tbTimeLoaned;
  674.     word         tbKbLoaned;
  675.     DateType     tbLastUsed;            /* Date last used         (Time Bank)   */
  676.  
  677.     byte         checkMail;             /* Check for mail at logon              */
  678.     byte         checkNewFiles;         /* Check for new files at logon         */
  679.  
  680.     dword        highMsgRead;
  681.  
  682.     word         qwkMaxMsgsPerArea;
  683.     word         qwkMaxMsgs;
  684.     byte         qwkArchiver;
  685.     byte         ripFont;
  686.  
  687.     DateType     tbTimePayback;
  688.     DateType     tbKbPayback;
  689.  
  690.     word         fileGroup;
  691.     word         msgGroup;
  692.  
  693.     byte         extra[390];
  694.   } USER_REC;
  695.  
  696.  
  697.  
  698. typedef struct
  699.   {
  700.    word     level;            /* User Level                            */
  701.    int      timelimit;        /* Time Limit                            */
  702.    int      daily_klimit;     /* Daily download limit                  */
  703.    int      pre_download;     /* Pre-download time limit               */
  704.    char     id[6];            /* Usergroup ID                          */
  705.    unsigned free;             /* Free upload in Kb.                    */
  706.    byte     factor;           /* Percentage upload required            */
  707.    unsigned max_download;     /* Max download for this level           */
  708.    word     fallto;           /* Fall to level x when max. reached     */
  709.    int      msgfactor;        /* # Kbytes granted per message written  */
  710.    char extra[5];
  711.  } LIMIT;
  712.  
  713. typedef struct
  714.    {
  715.       word        areaNum;
  716.       word        hudsonBase;    /* Number of Hudson message base           */
  717.       char        name[81];      /* Name of message areas                   */
  718.       byte        msgType;       /* Kind of message area (Net/Echo/Local)   */
  719.       byte        msgKind;       /* Type of message (Pvt only/Pub only/...) */
  720.       byte        msgBaseType;   /* Type of message base                    */
  721.       char        path[81];      /* Path to Squish or *.MSG                 */
  722.       byte        flags;         /* Alias allowed/forced/prohibited         */
  723.       word        readLevel;     /* Minimum level needed to read msgs       */
  724.       accessflags readFlags;     /* flags needed to read msgs               */
  725.       accessflags readFlagsNot;  /* flags non-grata to read msgs            */
  726.       word        writeLevel;    /* Minimum level needed to write msgs      */
  727.       accessflags writeFlags;    /* flags needed to write msgs              */
  728.       accessflags writeFlagsNot; /* flags non-grata to read msgs            */
  729.       word        sysopLevel;    /* Minimum level needed to change msgs     */
  730.       accessflags sysopFlags;    /* flags needed to change msgs             */
  731.       accessflags sysopFlagsNot; /* flags non-grata to read msgs            */
  732.  
  733.       char        origin[62];    /* Origin line                             */
  734.       int         aka;           /* AKA                                     */
  735.  
  736.       word        rcvKillDays;
  737.       word        msgKillDays;
  738.       word        maxMsgs;
  739.  
  740.       char        sysop[36];     /* Area Sysop                              */
  741.       int         replyBoard;    /* Area number where replies should go     */
  742.  
  743.       char        echoTag[61];   /* Echomail Tag Name                       */
  744.       char        qwkTag[13];    /* QWK Area Name                           */
  745.  
  746.       byte        groups[4];     /* Groups belonging to                     */
  747.       bool        allGroups;     /* Belongs to all groups                   */
  748.       byte        minAge;        /* Minimum age for this area               */
  749.  
  750.       byte        extra[112];
  751.    } MSGAREA;
  752.  
  753. typedef struct
  754.    {
  755.       char        name[80];             /* Name of file area                           */
  756.       char        listpath[80];         /* Path for file-list                          */
  757.       char        filepath[80];         /* Path for files                              */
  758.       word        level;                /* Level needed to access file area            */
  759.       accessflags flags;                /* Flags needed to access file area            */
  760.       bool        copyLocal;            /* TRUE = CDROM File listing type              */
  761.       int         maxfiles;             /* Max files per day in this area downloadable */
  762.       int         maxkb;                /* Max Kbytes per day in this area             */
  763.       bool        notops;               /* Set to TRUE if not to appear in TOPFILES.A* */
  764.       bool        free;                 /* If TRUE, this area is free                  */
  765.       byte        groups[4];            /* Groups belonging to                         */
  766.       bool        allGroups;            /* Belongs to all groups                       */
  767.       byte        minAge;               /* Minimum age                                 */
  768.       long        flagsNot;             /* Access flags                                */
  769.  
  770.       char        extra[3];
  771.    } FILEAREA;
  772.  
  773. typedef struct
  774.    {
  775.       long        num;
  776.       long        id;
  777.  
  778.       char        from[36];
  779.       char        to  [36];
  780.       char        subj[66];
  781.  
  782.       dword       attr;
  783.  
  784.       DateType    postDate;
  785.       TimeType    postTime;
  786.       DateType    recvDate;
  787.       TimeType    recvTime;
  788.  
  789.       long        next;
  790.       long        prev;
  791.  
  792.       int         origZone,
  793.                   origNet,
  794.                   origNode,
  795.                   origPoint;
  796.  
  797.       int         destZone,
  798.                   destNet,
  799.                   destNode,
  800.                   destPoint;
  801.  
  802.       int   cost;
  803.  
  804.       int   area;
  805.  
  806.       int   reserved2;
  807.    } MESSAGE;
  808.  
  809. typedef struct
  810.    {
  811.       short zone;
  812.       short net;
  813.       short node;
  814.       short point;
  815.    } FIDO_NODE;
  816.  
  817. typedef struct
  818.    {
  819.       char      shellmsg[81];         /* Message to show when shelling               */
  820.       char      sysopname[36];        /* Name of sysop                               */
  821.       char      txtpath[61];          /* Path for textfiles                          */
  822.       char      mnupath[61];          /* Path for menu-files                         */
  823.       char      msgpath[61];          /* Path for message base                       */
  824.       char      uploadpath[61];       /* Uploadpath                                  */
  825.       char      editorname[61];       /* Name of external editor                     */
  826.       word      newuserlevel;         /* Level for new user                          */
  827.       word      newuserloglevel;      /* Loglevel for new user                       */
  828.       long      newuserflags;         /* New user flags                              */
  829.       int       max_passinput;        /* Maximum attempts for password entry         */
  830.       int       min_passlength;       /* Minimum password length                     */
  831.       int       inactivity_time;      /* Inactivity time-out limit                   */
  832.       int       max_sysop_pages;      /* Maximum times sysop can be paged            */
  833.       int       pagebell_length;      /* Length of page-bell (secs)                  */
  834.       int       mailcheck;            /* Check for mail at logon?                    */
  835.       int       europe;               /* European date format?                       */
  836.       int       numnodes;             /* # nodes                                     */
  837.       int       allowansi;            /* Allow ANSI?                                 */
  838.       int       discrete;             /* Hide sysop activity?                        */
  839.       int       askphone;             /* Ask for phone number?                       */
  840.       int       allowoneword;         /* Allow one-word names                        */
  841.       word      crashlevel;           /* Level needed for crashmail                  */
  842.       long      crashflags;           /* Flags needed for crashmail                  */
  843.       word      attachlevel;          /* Level needed for file attach                */
  844.       long      attachflags;          /* Flags needed for file attach                */
  845.       int       allowmsgupload;       /* Allow message uploads                       */
  846.       int       allowstacking;        /* Allow command stacking                      */
  847.       byte      spare1[6];            /* not used                                    */
  848.       int       handshaking;          /* I/O Handshaking                             */
  849.       int       allowalias;           /* Allow alias for login                       */
  850.       int       loglocal;             /* Log local calls                             */
  851.       int       doswap;               /* Allow swapping                              */
  852.       char      originline[61];       /* Origin line                                 */
  853.       char      nodelistdir[61];      /* Nodelist directory                          */
  854.       char      sysopkeys[10][60];    /* Sysop hotkeys                               */
  855.       byte      spare2[6];            /* not used                                    */
  856.       int       uploadspace;          /* Space needed for uploads                    */
  857.       char      pvtuploadpath[61];    /* Directory for files uploads                 */
  858.       char      quotestring[6];       /* String used for quoting                     */
  859.       int       fastmode;             /* Use fast mode (=needs more memory)          */
  860.       int       killsent;             /* Kill netmail after sent                     */
  861.       bool      egamode;              /* Use 43/50 line mode                         */
  862.       bool      showuserinfo;         /* Show user info while in EGA mode?           */
  863.       char      pexpath[61];          /* Directory for PEX-files                     */
  864.       int       allowquicklogin;      /* Allow quick sysop login?                    */
  865.       int       securityboard;        /* MsgBoard for security messages              */
  866.       int       pwdmessages;          /* Write security-messages?                    */
  867.       char      bbsname[36];          /* Name of the BBS                             */
  868.       char      pwdchar;              /* Password character                          */
  869.       int       tb_maxtimedeposit;
  870.       int       tb_maxkbdeposit;
  871.       int       tb_maxtimewithdrawal;
  872.       int       tb_maxkbwithdrawal;
  873.       int       usage_days;           /* Days to keep usage graphs                   */
  874.       char      systempwd[16];        /* System password                             */
  875.       bool      usesystempwd;         /* Use system password?                        */
  876.       bool      askbirthdate;         /* Ask Birth Date?                             */
  877.       int       binlogdays;           /* # days to log in BINLOG.PB                  */
  878.       bool      binloglocal;          /* Log local calls to BINLOG.PB yes/no         */
  879.       int       pageArea;             /* Area number for page messages               */
  880.       bool      indexfiles;           /* Indexed FILES.BBS (obsolete)                */
  881.       bool      checkdupes;           /* Check duplicate uploads                     */
  882.       bool      killdupes;            /* Kill duplicate uploads                      */
  883.       bool      ignore_ext;           /* Ignore file extension for dupe-search       */
  884.       char      RIPpath[61];          /* Path for RIP scripts                        */
  885.       char      iconspath[61];        /* Path for RIP icons                          */
  886.       char      location[36];         /* BBS Location (City)                         */
  887.       char      phone[26];            /* BBS Phone Number                            */
  888.       char      QWKid[9];             /* Base file name for QWK packets (BBSID)      */
  889.       word      IObuffersize;         /* I/O buffer size in bytes                    */
  890.       TimeFrame pagingHours;          /* Paging Hours                                */
  891.       char      defaultLanguage[9];   /* Default language                            */
  892.       bool      addUploaderName;      /* Add uploader's name to FILES.BBS            */
  893.       TimeFrame downloadHours;        /* Download Hours                              */
  894.       bool      askdataphone;         /* Ask for data phone #                        */
  895.       bool      askfaxphone;          /* Ask for fax phone #                         */
  896.       bool      askaddress;           /* Ask for mailing address                     */
  897.       bool      asksex;               /* Ask sex                                     */
  898.       bool      askdateformat;        /* Ask date format                             */
  899.       bool      askstate;             /* Ask state                                   */
  900.       bool      askcountry;           /* Ask country                                 */
  901.       word      fuzzyRate;            /* Fuzzy search rate for user editor (0-100)   */
  902.       bool      hidePassword;         /* Hide password in user editor                */
  903.       bool      valConfirm;           /* Confirm validation in user editor           */
  904.  
  905.       byte      spare3[17];
  906.  
  907.       byte      extra[255];
  908.   } CONFIG;
  909.  
  910. typedef struct
  911.    {
  912.       DateType date;
  913.       TimeType timeIn;
  914.       TimeType timeOut;
  915.       char     name[36];
  916.       char     city[26];
  917.       char     country[26];
  918.       long     baud;
  919.       word     node;
  920.       long     kbDown;
  921.       long     kbUp;
  922.       word     yells;
  923.       word     level;
  924.       dword    uflags;
  925.       char     alias[36];
  926.       byte     extra[45];
  927.    } BINLOG;
  928.  
  929. typedef struct
  930.    {
  931.       char name[13];
  932.       word area;
  933.    } TAGGED_FILE;
  934.  
  935. /***** Long math substitution functions *****/
  936.  
  937. long l_mul(long val1,long val2);
  938. long l_div(long val1,long val2);
  939. long l_mod(long val1,long val2);
  940. long l_shl(long val,unsigned s);
  941. long l_shr(long val,unsigned s);
  942.  
  943. dword ul_div(dword val1,dword val2);
  944. dword ul_mod(dword val1,dword val2);
  945. dword ul_shl(dword val,word s);
  946. dword ul_shr(dword val,word s);
  947.  
  948. #ifdef __cplusplus
  949.  
  950.  inline bool GetFlag(dword flags,int flag)
  951.     {
  952.      return ((flags & ul_shl(1,32-flag)) ? TRUE:FALSE );
  953.     }
  954.  
  955.  inline void SetFlag(dword &flags,int flag)
  956.     {
  957.      flags |= ul_shl(1,32-flag);
  958.     }
  959.  
  960.  inline void ClearFlag(dword &flags,int flag)
  961.     {
  962.      flags &= ~ul_shl(1,32-flag);
  963.     }
  964.  
  965.  inline void InitMessage(MESSAGE *msg)
  966.     {
  967.      memset(msg,0,sizeof(MESSAGE));
  968.     }
  969.  
  970. #else
  971.  
  972.  #define GetFlag(flags,flag)   (((flags) &   ul_shl(1,32-(flag)))?TRUE:FALSE)
  973.  #define SetFlag(flags,flag)   { (flags) |=  ul_shl(1,32-(flag)); }
  974.  #define ClearFlag(flags,flag) { (flags) &= ~ul_shl(1,32-(flag)); }
  975.  
  976. #endif
  977.  
  978. /* You can use these constants to manipulate user flags (by using the */
  979. /* functions/macros GetFlag, SetFlag and ClearFlag                    */
  980.  
  981. #define FLAG_A 1
  982. #define FLAG_B 2
  983. #define FLAG_C 3
  984. #define FLAG_D 4
  985. #define FLAG_E 5
  986. #define FLAG_F 6
  987. #define FLAG_G 7
  988. #define FLAG_H 8
  989. #define FLAG_I 9
  990. #define FLAG_J 10
  991. #define FLAG_K 11
  992. #define FLAG_L 12
  993. #define FLAG_M 13
  994. #define FLAG_N 14
  995. #define FLAG_O 15
  996. #define FLAG_P 16
  997. #define FLAG_Q 17
  998. #define FLAG_R 18
  999. #define FLAG_S 19
  1000. #define FLAG_T 20
  1001. #define FLAG_U 21
  1002. #define FLAG_V 22
  1003. #define FLAG_W 23
  1004. #define FLAG_X 24
  1005. #define FLAG_Y 25
  1006. #define FLAG_Z 26
  1007. #define FLAG_1 27
  1008. #define FLAG_2 28
  1009. #define FLAG_3 29
  1010. #define FLAG_4 30
  1011. #define FLAG_5 31
  1012. #define FLAG_6 32
  1013.  
  1014. /*****************************************************************************/
  1015. /****  Global ProBoard variables  ********************************************/
  1016. /*****************************************************************************/
  1017.  
  1018. extern USER_REC     * const CurUser;      /* Current user online        (R/W) */
  1019. extern int            const UserRecNr;    /* Record # of current user   (R/O) */
  1020. extern int            const NumLimits;    /* # limits in limits[] array (R/O) */
  1021. extern LIMIT  const * const Limits;       /* Limits per level           (R/O) */
  1022. extern char         * const LoginDate;    /* Login date of user         (R/W) */
  1023. extern char         * const LoginTime;    /* Login time of user         (R/W) */
  1024. extern bool           const NetEntered;   /* Netmail entered            (R/O) */
  1025. extern bool           const EchoEntered;  /* Echomail entered           (R/O) */
  1026. extern int            const NumUsers;     /* # users in userfile        (R/O) */
  1027. extern int            const NodeNumber;   /* Current node number        (R/O) */
  1028. extern char   const * const CurMenu;      /* Current menu name          (R/O) */
  1029. extern char   const * const UserFirstName;/* First name of current user (R/O) */
  1030. extern char   const * const PrevUser;     /* Name of previous user      (R/O) */
  1031. extern char   const * const StartupPath;  /* Startup path               (R/O) */
  1032. extern char   const * const SysPath;      /* ProBoard system path       (R/O) */
  1033. extern CONFIG const * const Config;       /* ProBoard config-record     (R/O) */
  1034. extern word           const PBVersion;    /* Version number of ProBoard (R/O) */
  1035. extern long           const BaudRate;     /* Baud rate (0=local)        (R/O) */
  1036. extern word           const Beta;         /* Beta nr (0xFFFF=release)   (R/O) */
  1037. extern char         * const PageReason;   /* Reason for sysop paging    (R/W) */
  1038. extern word         * const PageCount;    /* Number of sysop pages      (R/W) */
  1039.  
  1040. char *form(char *, ...);                         /* From old C++ streams lib */
  1041.  
  1042. /*****************************************************************************/
  1043. /****  Message functions  ****************************************************/
  1044. /*****************************************************************************/
  1045.  
  1046. void MsgEd(void);
  1047. int  PostMessage(const char *from,const char *to,const char *subject,int area,bool pvt);
  1048. int  PostNetmail(const char *from,const char *to,const char *subject,int area,const FIDO_NODE *address,bool attach,bool crash,bool kill);
  1049. bool ReadMsgArea(int area,MSGAREA *ma);
  1050. int  NumMsgAreas(void);
  1051. long GetLastRead(int areanum , long user_recno);
  1052. void SetLastRead(int areanum , long user_recno , long msgid);
  1053. long NumMsgs(int areanum);
  1054. long HighMsg(int areanum);
  1055. long MsgNum(int areanum , long id);
  1056. long MsgId (int areanum , long num);
  1057. bool ReadMessage(MESSAGE *msg,long msgid,int areanum);
  1058. void WriteMSGTMP(const char *text);
  1059. void AppendMSGTMP(const char *text);
  1060. void ShowMessage(const MESSAGE *msg);
  1061. void CreateMessageText(const MESSAGE *msg);
  1062. void CreateMessageTextString(const MESSAGE *msg,char *text,int maxsize);
  1063. bool FirstMessage(MESSAGE *msg,int area,int order,long first);
  1064. bool NextMessage(MESSAGE *msg,int area,int order);
  1065. void DeleteMessage(MESSAGE *msg);
  1066. void MarkMessage(int area,long msgid);
  1067. void ReadMarkedMessages(void);
  1068. void ListMarkedMessages(void);
  1069. void UnMarkAllMessages(void);
  1070.  
  1071.  
  1072. /*****************************************************************************/
  1073. /****  Time functions  *******************************************************/
  1074. /*****************************************************************************/
  1075.  
  1076. void AddTime(int plusminus);
  1077. int  TimeLeft(void);
  1078. int  TimeOnline(void);
  1079. void SuspendTimer(void);
  1080. void RestartTimer(void);
  1081. void AdjustTime(void);
  1082. int  TimeUntilEvent(void);
  1083.  
  1084.  
  1085. /*****************************************************************************/
  1086. /****  Low-level I/O functions  **********************************************/
  1087. /*****************************************************************************/
  1088.  
  1089. bool IO_SendByte(byte);                   /* TRUE = byte sent, FALSE = buffer full */
  1090. int  IO_ReadByte(void);                   /* Returns -1 if no byte available       */
  1091. bool IO_Carrier(void);                    /* TRUE = carrier available              */
  1092. bool IO_ByteReady(void);                  /* TRUE = byte available in input buffer */
  1093. bool IO_BufEmpty(void);                   /* TRUE = output buffer is empty         */
  1094. void IO_StartBreak(void);                 /* Start sending a break                 */
  1095. void IO_StopBreak(void);                  /* Stop sending a break                  */
  1096. void IO_DTR(bool);                        /* Set/lower DTR line (TRUE = set)       */
  1097. word IO_SendBlock(byte *buf,word size);   /* Send block of bytes, returns # bytes actually sent */
  1098. word IO_ReadBlock(byte *buf,word size);   /* Read block of bytes, returns # bytes actually read */
  1099.  
  1100. /*****************************************************************************/
  1101. /****  I/O functions  ********************************************************/
  1102. /*****************************************************************************/
  1103. /* Note : some I/O is done through the standard library functions printf(),
  1104.  *        puts(), putchar(), getchar(), gets() and vprintf()
  1105.  *****************************************************************************/
  1106.  
  1107. char WaitKey(void);
  1108. char WaitKeys(const char *);
  1109. void Input(char *buf,int len,int readmode);
  1110. bool Ask(bool def);
  1111. char PeekChar(void);
  1112. void SetColor(char color);
  1113. void SetFullColor(byte color);
  1114. void GotoXY(int x,int y);
  1115. void ClrEol(void);
  1116. void EnableStop(void);
  1117. void DisableStop(void);
  1118. bool Stopped(void);
  1119. bool ExternalInput(void);
  1120. char ShowHotkeyFile(const char *fname,const char *hotkeys);
  1121. char ShowHotkeyANSIFile(const char *fname,const char *hotkeys);
  1122. bool ShowRIPscrip(char *fn);
  1123. void InitLineCounter(void);
  1124. bool LineCounter(void);
  1125. void ResetInactivity(void);
  1126. bool LocalDisplay( bool );
  1127. bool RemoteDisplay( bool );
  1128. bool RIP(void);
  1129. void ParseStringVars(char *input,char *result,int max_len);
  1130.  
  1131. int  FuzzySearch(char *text,char *search,int degree);
  1132.  
  1133. bool ReadUser(USER_REC *rec,long recnr);
  1134. void WriteUser(const USER_REC *rec);
  1135. bool SetUser(long recnr);
  1136.  
  1137. char PlayMusic(const char *fname,const char *hotkeys);
  1138. void PostInfo(const char *fname);
  1139. int  ReadFileArea(int area,FILEAREA *ma);
  1140. int  NumFileAreas(void);
  1141. long MemAvail(void);
  1142. void MenuFunction(int,const char *);
  1143. void Log(int loglevel,const char *fmtstring,...);
  1144. void HangUp(void);
  1145. bool CheckAccess(word level,accessflags flags);
  1146. KEY  ScanKey(void);
  1147. void exit(void);
  1148. void ExitTSR(void);
  1149. int  ErrorLevel(void);
  1150.  
  1151. int  GetTaggedFiles(TAGGED_FILE *array,int max);
  1152. bool PutTaggedFiles(TAGGED_FILE *array,int n);
  1153. bool AddTaggedFile(TAGGED_FILE *tag);
  1154. bool RemoveTaggedFile(TAGGED_FILE *tag);
  1155. void ClearTaggedFiles();
  1156. bool IsTagged(TAGGED_FILE *tag);
  1157.  
  1158. bool GetIniVar(char *fname,char *varname,char *value,int max);
  1159. bool SetIniVar(char *fname,char *varname,char *value);
  1160.  
  1161. int  _InstallHandler(int handler,int (*func)(void),unsigned ds);
  1162. void _RemoveHandler(int handler,int (*func)(void),unsigned ds);
  1163.  
  1164. #define InstallHandler(handler,func) _InstallHandler(handler,(int (*)(void))(func),FP_SEG(&NetEntered));
  1165. #define RemoveHandler(handler,func)  _RemoveHandler(handler,(int (*)(void))(func),FP_SEG(&NetEntered));
  1166.  
  1167. #ifdef __cplusplus
  1168.  }
  1169.  
  1170. inline void * operator new   (unsigned size)    { return malloc(size); }
  1171. inline void   operator delete(void *p)          { free(p); }
  1172.  
  1173. #endif
  1174. #endif
  1175.